/* 基础布局样式 */
.chat-container {
    height: calc(100vh - 180px);
    overflow-y: auto;
}

/* 输入框容器样式 */
.input-container {
    position: relative;
    width: 80%;
    margin: 0 auto;
}

/* 输入框样式 */
#userInput {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 9999px;
    padding: 10px 40px 10px 15px;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ccc;
}

/* 发送图标样式 */
.send-icon {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    cursor: pointer;
    color: #3b82f6;
}

.send-icon:hover {
    color: #2563eb;
}

/* 时间戳样式 */
.timestamp {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* 头像样式 */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}

.user-avatar {
    background-color: #4a90e2;
}

.assistant-avatar {
    background-color: #42b983;
}

/* 加载动画样式 */
.loading-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.loading-dots {
    display: flex;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    margin: 0 2px;
    background-color: #888;
    border-radius: 50%;
    animation: loading 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loading {
    0%, 80%, 100% { 
        transform: scale(0);
    } 
    40% { 
        transform: scale(1.0);
    }
}

/* 会话列表样式 */
#sessionsList {
    scrollbar-width: thin;
}

#sessionsList::-webkit-scrollbar {
    width: 6px;
}

#sessionsList::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#sessionsList::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

#sessionsList::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.session-item {
    transition: all 0.2s ease;
}

.session-item:hover {
    transform: translateY(-1px);
}

.session-item button {
    visibility: hidden;
}

.session-item:hover button {
    visibility: visible;
}


/* 在现有的侧边栏样式基础上增强 */
.sidebar {
    transition: left 0.3s ease-in-out, transform 0.3s ease-in-out;
    height: 100%;
}

/* 遮罩层 */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 30;
    display: none;
}

/* 添加桌面版侧边栏切换样式 */
@media (min-width: 769px) {
    .sidebar {
        width: 25% !important;  /* 对应 w-1/4 */
        min-width: 300px;      /* 最小宽度 */
        max-width: 400px;      /* 最大宽度 */
        flex-shrink: 0;        /* 防止压缩 */
    }
    
    .sidebar.collapsed {
        width: 0 !important;
        padding: 0;
        overflow: hidden;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar-toggle {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: 80% !important; /* 移动设备上侧边栏宽度 */
        max-width: 300px;
        z-index: 40;
    }
    
    .sidebar.open {
        left: 0;
    }
}

/* 停止按钮样式 */
.stop-generation-btn {
    display: inline-flex;
    align-items: center;
    transition: all 0.2s;
}

.stop-generation-btn:hover {
    background-color: #fee2e2;
}

/* 会话状态指示器 */
.session-status-indicator {
    margin-top: 4px;
}

/* 脉冲动画 */
.animate-pulse {
    animation: pulse 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.3;
    }
}